<template>
  <div id="name">  

     <el-form ref="form"  label-width="80px">  
     <el-row> 

        <el-col :span="24" style="display:flex;">
             <div style="height:38px;line-height:38px;"> 
                  <i class="el-icon-back" @click="goBack"></i> 
              </div> 
              <el-form-item label="" label-width="0px" style="margin-left:10px;margin-bottom:0px !important;">
                <el-date-picker 
                :picker-options="pickerOptions" @change="select_change" type="month" placeholder="选择日期" format="yyyy-MM" value-format="yyyy-MM"  v-model="form.time"  style="width:150px;"></el-date-picker>
            </el-form-item>  
              <el-form-item label-width="0px" style="margin-left:10px;">
                <el-select  v-model="form.select1_num" placeholder="请选择等级" style="width:160px;" @change="select_change1">
                    <el-option  v-for="(item,index) in select1_data" :key="index" :label="item.title" :value="item.maid"></el-option>
                </el-select>
             </el-form-item>
              <div class="custom_button2"  style="margin-left:10px;" @click="search_but1()"></div>
        </el-col> 
            
    </el-row> 
   
   </el-form>

   <!-- 渲染数据list -->
   <details-monitor3-list :datalist="datalist" @up_list_fun="list_fun" :loading="loading"> </details-monitor3-list>

         
  </div>
</template>

<script>
import DetailsMonitor3List from '@/view/Operationdata/Monitor/DetailsMonitor3List'
export default {
  name: 'name',
  data () {
    return {
        pickerOptions: { // 计费日期的约束条件
          disabledDate(time) {
              return time.getTime() < new Date('2021-02').getTime()
              }
        },
        datalist:[],
        loading:true,
        form:{
           time:'',
           select1_num:'',
        },
        select1_data:[],


    }
  },
 components:{
    DetailsMonitor3List
  },
  created(){
    this.form.time = this.getNowDate3()
    this.list_zy()
   
  },
  mounted (){
    
  },
  methods: {
    list_zy(){
      this.post("/manor/manorOption", {
       }).then(res => { 
           this.select1_data = res.result    
           this.form.select1_num = this.select1_data[0].maid   
           this.list_fun()          
       })
    },
    list_fun(){
        this.post("/Control/goodsMonthSaleList", {
              starttime:this.form.time,
              maid:this.form.select1_num 
	         }).then(res => {
            this.datalist = res.result
            this.loading = false
            console.log(res)
          })
    },  
    select_change(){
       
    },
    select_change1(){
          
    },
    search_but1(){
       this.loading = true
      this.list_fun()
    },
    goBack() {
      this.$router.go(-1)
    },
  }
}
</script>


<style scoped>

[v-cloak]{
    display: none;
}

</style>
